POV-Ray : Newsgroups : povray.binaries.images : N-Body Simulation : N-Body Simulation Server Time
1 Aug 2024 12:19:51 EDT (-0400)
  N-Body Simulation  
From: triple r
Date: 3 Aug 2008 14:00:01
Message: <web.4895f19fe5f40d6fef2b9ba40@news.povray.org>
Regarding the recent post in p.b.o-t about RK methods and n-body simulations,
here's what happens if you use the tree method.  See p.b.a. for animation.  The
simulation itself only took a couple hours up to this point with 30000
particles.

Again, it's not actually correct, but there's a threshold parameter that
determines when calculating forces whether the ratio of the potential size of a
node relative to the distance to that node is large enough that you need to look
at the children more closely.  If the threshold is zero then you look at the
whole tree ( O(n^2) ); if it's too big you overlook a lot of detail ( O(n log
n) ).  Somewhere in the middle is apparently a good enough compromise to within
a few percent.  The  force calculation is expensive enough that building the
tree at each RK sub-time-step is very little overhead.

There's a c program with an OpenGL interface if anyone's interested although
I'll have to make a couple parameters more obvious before posting.  Thanks for
the fun idea!

 - Ricky


Post a reply to this message


Attachments:
Download 'nbody.jpg' (121 KB)

Preview of image 'nbody.jpg'
nbody.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.